package com.clinic.entity.param;

import org.apache.commons.lang.xwork.StringUtils;

import com.clinic.entity.type.UserType;

public class SessionUser {

	private long userId;
	private String name;
	private UserType type;
	private boolean admin;
	
	public boolean isAvailable() {
		return (userId > 0 && StringUtils.isNotBlank(name) && type != null);
	} 
	
	public long getUserId() {
		return userId;
	}
	
	public void setUserId(long userId) {
		this.userId = userId;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getTypeString() {
		return type.name().toLowerCase();
	}
	
	public UserType getType() {
		return type;
	}
	
	public void setType(UserType type) {
		this.type = type;
	}

	public boolean isAdmin() {
		return admin;
	}

	public void setAdmin(boolean admin) {
		this.admin = admin;
	}
}
